﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——销售结算单明细
    /// </summary>
    [Serializable]
    [Description("销售结算单明细")]
    public class SellStatementDetail :  EntityBase,ICreatedTime, IAudited
    {
        /// <summary>
        ///采购结算单
        /// </summary>
        [Display(Name = "采购结算单")]
        public virtual SellStatement SellStatement { get; set; }
        /// <summary>
        ///采购结算单外键
        /// </summary>
        [Display(Name = "采购结算单外键")]
        public long SellStatementId { get; set; }

        /// <summary>
        ///应付账单
        /// </summary>
        [Display(Name = "应付账单")]
        public virtual SellBill SellBill { get; set; }
        /// <summary>
        ///应付账单外键
        /// </summary>
        [Display(Name = "应付账单外键")]
        public long SellBillId { get; set; }

        /// <summary>
        ///结算前金额
        /// </summary>
        [Display(Name = "结算前金额")]
        [Required]
        public double BeforeMoney { get; set; }

        /// <summary>
        ///本次结算金额
        /// </summary>
        [Display(Name = "本次结算金额")]
        [Required]
        public double Money { get; set; }

        /// <summary>
        ///结算后金额
        /// </summary>
        [Display(Name = "结算后金额")]
        [Required]
        public double LastedMoney { get; set; }

        /// <summary>
        ///备注
        /// </summary>
        [Display(Name = "备注")]
        [StringLength(500)]
        public string Remark { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
    }
}
